<?php

class Test_Application_Registry_Session extends TestCase {
    
    public function setUp() {
        parent::setUp();
    }
    
    public function testCreate() {
        $registry = Application_Registry_Session::getInstance();
        self::assertTrue($registry instanceof Application_Registry_Session);     
//        print_r(array_keys($_SESSION));
//        print_r(array_keys($registry->getValues()));
        self::assertEquals(array_keys($_SESSION[get_class($registry)]), array_keys($registry->getValues()));
        
    }
    
    public function testSet() {
        $registry = Application_Registry_Session::getInstance();
        $registry->foo = 'bar';
        self::assertEquals('bar', $registry->foo);
    }
    
    public function testSetArray() {
        $array = array (
                            'foo'      => 'bar',
                            'fooArray' => array (
                                                    'foo1' => 'bar1',
                                                    'foo2' => 'bar2'
                                                )
                       );
        $registry = Application_Registry_Session::getInstance();
        $registry->fooArray = $array;
        self::assertEquals($array, $registry->fooArray);
    }
    
    public function testSetObject() {
        $object = new stdClass();
        $object->foo = 'bar';
        
        $registry = Application_Registry_Session::getInstance();
        $registry->fooObject = $object;
        self::assertEquals($object, $registry->fooObject);
    }
    
}

?>